from airflow.models.idata_task import Task
from airflow.utils.session import create_session
from airflow.utils.sqlalchemy import skip_locked, with_row_locks
import time

with create_session() as session:
    qry = session.query(Task).filter(Task.id == 1)
    task = with_row_locks(qry, of=Task, **skip_locked(session=session)).first()
    print(task)
    time.sleep(6)
